<?php 


/** 
***************************************************
*欢迎使用免费版xSite企业自助建站软件！
*这是一个专业为搜索引擎营销而设计的，极稳定、极易维护的建站软件！
*官方客服：help@php.net.cn
*官方下载网址：http://www.php.net.cn/xsite/ 
***************************************************
**/




 if(!defined('IN_SITETEAM')) { exit('Access Denied'); } $user_theme_upload_dir = "{$user_upload_dir}/theme/{$skinid}"; if (!file_exists($user_theme_upload_dir)) { if (!file_exists("{$user_upload_dir}/theme")) { mkdir("{$user_upload_dir}/theme"); } if (!file_exists($user_theme_upload_dir)) { mkdir($user_theme_upload_dir); } } if (!file_exists(SITE_DIR . "/templates/{$skinid}/style.txt")) { message("xsite.php?action=block&operation=list", "该套模板风格不需要进行配置！"); } if (!empty($_POST['dosubmit'])) { $savedata = $_POST['data']; if (isset($_POST['del_file']) && is_array($_POST['del_file']) && count($_POST['del_file'])) { foreach ($_POST['del_file'] as $k => $v) { if (array_key_exists($k, $savedata) && $v == $savedata[$k]) { if (file_exists($savedata[$k]) && preg_match("/^attachments/i", $savedata[$k])) @unlink($savedata[$k]); $savedata[$k] = ''; } } } $style = read_array_file(SITE_DIR . "/templates/{$skinid}/style.txt"); if (is_array($style) && count($style)) { foreach ($style as $k => $v) { if ($v['type'] == 'file') { if (!empty($_FILES[$k]['name'])) { $fileinfo = upload_images($k, "{$user_theme_upload_dir}", 0); if (is_array($fileinfo) && array_key_exists('name', $fileinfo) && array_key_exists('path', $fileinfo)) { if (!empty($savedata[$k])) { if (file_exists($savedata[$k])) { @unlink($savedata[$k]); } } $savedata[$k] = str_replace(SITE_DIR . '/', '', "{$fileinfo['path']}{$fileinfo['name']}"); } } } } } save_array_file($savedata, "{$user_data_dir}/style.{$skinid}.txt"); message("xsite.php?action=tplconfig", "编辑成功"); } else { $style = read_array_file(SITE_DIR . "/templates/{$skinid}/style.txt"); if (file_exists("{$user_data_dir}/style.{$skinid}.txt")) { $style_data = read_array_file("{$user_data_dir}/style.{$skinid}.txt"); foreach ($style as $k => $v) { if (array_key_exists($k, $style_data)) { $style[$k]['value'] = $style_data[$k]; } } } include SITE_ROOT . "/admin/tpl/tplconfig.tpl.php"; }